Rearrange code in __start_xen() to work around internal
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 12 Aug 2005 09:14:02 +0000 (09:14 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 12 Aug 2005 09:14:02 +0000 (09:14 +0000)
compiler error in x86/64 gcc.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/setup.c

index fcf7f522b838083463f3533c8ffc772a5cdbf950..070a9127b288534addccdb2dc399476e66a7d628 100644 (file)
@@ -336,26 +336,25 @@ void __init __start_xen(multiboot_info_t *mbi)
     /* Find a large enough RAM extent to stash the DOM0 modules. */
     for ( i = 0; ; i++ )
     {
-        if ( (e820.map[i].type == E820_RAM) &&
-             (e820.map[i].size >= modules_length) &&
-             ((e820.map[i].addr + e820.map[i].size) >=
-              (xenheap_phys_end + modules_length)) )
-        {
-            /* Stash as near as possible to the beginning of the RAM extent. */
-            initial_images_start = e820.map[i].addr;
-            if ( initial_images_start < xenheap_phys_end )
-                initial_images_start = xenheap_phys_end;
-            initial_images_end = initial_images_start + modules_length;
-            break;
-        }
-
         if ( i == e820.nr_map )
         {
             printk("Not enough memory to stash the DOM0 kernel image.\n");
             for ( ; ; ) ;
         }
+        
+        if ( (e820.map[i].type == E820_RAM) &&
+             (e820.map[i].size >= modules_length) &&
+             ((e820.map[i].addr + e820.map[i].size) >=
+              (xenheap_phys_end + modules_length)) )
+            break;
     }
 
+    /* Stash as near as possible to the beginning of the RAM extent. */
+    initial_images_start = e820.map[i].addr;
+    if ( initial_images_start < xenheap_phys_end )
+        initial_images_start = xenheap_phys_end;
+    initial_images_end = initial_images_start + modules_length;
+
 #if defined(CONFIG_X86_32)
     memmove((void *)initial_images_start,  /* use low mapping */
             (void *)mod[0].mod_start,      /* use low mapping */